#!/bin/bash
usage()
{
  echo "Usage: $0 <rec name>"
}
RECNAME=$1
if [ -z "$RECNAME" ]
then
  usage
  exit 1
fi
ONECFG=""
ROOTDIRS=/mnt/disk
I=0
while [ -z "$ONECFG" ]
do
  ONECFG=`find ${ROOTDIRS}${I} -name ${RECNAME}.cfg`
  #ONECFG=`find ${ROOTDIRS}* -name ${RECNAME}.cfg |head -n1`
  I=$(($I+1))
done
#Find is sooo slow
#ONECFG=/mnt/unionfs/${RECNAME}/${RECNAME}.cfg
PSIZE=`cat $ONECFG |grep packet_size|awk '{print $3}'|sed 's/[^0-9]//g'`
echo $PSIZE

for j in `find /mnt/disk*/${RECNAME}/ | egrep '[0-9]{8}\$' |sort -n -t . -k 2`
do
  echo file ${j}:
  check_64_seq $j $PSIZE
done
